package org.metasketch.editor.perspectives;

import org.metasketch.editor.Project;
import org.metasketch.editor.project.MultipleProject;
import org.metasketch.editor.project.ProjectType;

public class MultipleProjectBaseLayout extends BaseLayout {

	protected ProjectType projectType;

	public MultipleProjectBaseLayout(BaseDiagrammaticPerspective perspective,
			ProjectType projectType) {
		super(perspective);
		this.projectType = projectType;
		
		create();
	}

	@Override
	public void setup(Project project) {
//		create();

		try {
			if (project == null)
				return;

			if (projectType == ProjectType.HAM) {
				super.setup(((MultipleProject) project).getHamProject());
			} else if (projectType == ProjectType.DEMO) {
				super.setup(((MultipleProject) project).getDemoProject());
			}

		} catch (Throwable e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
